import { createChain, addBlock, verifyChain, changeBlock } from './util.js';

const GENESIS_HASH = createChain('I am the Genesis Block of Minar Block Chain!');
addBlock(GENESIS_HASH, '1');
addBlock(GENESIS_HASH, '2');
const block = addBlock(GENESIS_HASH, '3');
console.log(
  verifyChain(GENESIS_HASH, (block) => console.log(block.data.toString()))
);
changeBlock(block, '4')
console.log(
  verifyChain(GENESIS_HASH, (block) => console.log(block.data.toString()))
);